package model.geometry;

/**
 * Created by andreas on 19.04.14.
 */
public class TriangleDrawer extends AbstractDrawer {

    private HorizontalDrawer horizontalDrawer = new HorizontalDrawer();

    public String drawRightTriangle(int size) {
        return drawTriangleRecursiv(0, size, "");
    }

    private String drawTriangleRecursiv(int i, int size, String accumulator) {
        if (i==size) {
            return accumulator;
        } else {
            final String newLine = i < size - 1 ? "\n" : "";
            return drawTriangleRecursiv(i + 1, size, accumulator + drawAsterix(i + 1) + newLine);
        }
    }
}
